"use client"

import { useState } from "react"
import { LoginPage } from "@/components/login-page"
import { BluetoothPage } from "@/components/bluetooth-page"
import { DashboardPage } from "@/components/dashboard-page"
import { TrainingPage } from "@/components/training-page"

export default function App() {
  const [currentPage, setCurrentPage] = useState<"login" | "bluetooth" | "dashboard" | "training">("login")
  const [isLoggedIn, setIsLoggedIn] = useState(false)
  const [isConnected, setIsConnected] = useState(false)

  const handleLogin = () => {
    setIsLoggedIn(true)
    setCurrentPage("bluetooth")
  }

  const handleConnect = () => {
    setIsConnected(true)
    setCurrentPage("dashboard")
  }

  const handleStartTraining = () => {
    setCurrentPage("training")
  }

  const handleBackToDashboard = () => {
    setCurrentPage("dashboard")
  }

  return (
    <div className="min-h-screen bg-gray-50">
      {currentPage === "login" && <LoginPage onLogin={handleLogin} />}
      {currentPage === "bluetooth" && <BluetoothPage onConnect={handleConnect} />}
      {currentPage === "dashboard" && <DashboardPage onStartTraining={handleStartTraining} />}
      {currentPage === "training" && <TrainingPage onBack={handleBackToDashboard} />}
    </div>
  )
}
